var _o92;
var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_ScreenshotManager = _o92 = /* */function () {
  function _ctor() {
    babel_classCallCheck(this, _ctor);
    this._cameras = new Map();
    this._spriteFrames = new Map();
    this._renderTexture = new Map();
  }
  return babel_createClass(_ctor, [{
    key: "init",
    value: function init(e, t) {
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
      var _o93 = new cc.RenderTexture();
      t || (t = cc.size(cc.visibleRect.width, cc.visibleRect.height));
      var i = cc.game._renderContext;
      _o93.initWithSize(t.width, t.height, i.STENCIL_INDEX8);
      e.targetTexture = _o93;
      this._cameras.set(e.node.name, e);
      this._renderTexture.set(e.node.name, _o93);
      this._spriteFrames.set(e.node.name, new cc.SpriteFrame(_o93));
      e.enabled = n;
    }
  }, {
    key: "snapshot",
    value: function snapshot(e, t) {
      this._cameras.has(e.node.name) && this.init(e, cc.size(t.width, t.height), e.enabled);
      var n = this._renderTexture.get(e.node.name);
      if (t) {
        var _e38 = cc.game._renderContext;
        n.width == t.width && n.height == t.height || n.initWithSize(t.width, t.height, _e38.STENCIL_INDEX8);
      }
      e.render(t || cc.Canvas.instance.node);
      var _o94 = this._spriteFrames.get(e.node.name);
      _o94.setTexture(n);
      return _o94;
    }
  }], [{
    key: "getInstance",
    value: function getInstance() {
      null == this._instance && (this._instance = new _o92());
      return this._instance;
    }
  }]);
}();
def_ScreenshotManager._instance = null;
def_ScreenshotManager = _o92 = cc__decorate([ccp_ccclass], def_ScreenshotManager);
exports.default = def_ScreenshotManager;